<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="700" border="1" cellspacing="0" cellpadding="10">
  <tr>
    <th scope="col" style="width:150px;">Shop</th>
    <th scope="col">Detail</th>
  </tr>
  <?php foreach($this->arrRes as $shop => $detail){?>
  <tr>
    <td><?php echo $shop;?></td>
    <td><?php 
	if(count($detail)==0){ echo "0";}
	else{
	?>
      <table width="100%" border="1" cellspacing="0" cellpadding="10">
        <tr>
          <th scope="col">ID</th>
          <th scope="col">Code</th>
          <th scope="col">Job ID</th>
          <th scope="col">Date</th>
          <th scope="col">Tech</th>
          <th scope="col">Comment</th>
        </tr>
        <?php foreach($detail as $row) {?>
        <tr>
          <td><?php echo $row['id_faulty']?></td>
          <td><?php echo $row['product_code_faulty']?></td>
          <td><?php echo  $row['id_repair_job']?></td>
          <td><?php echo  $row['date_faulty']?></td>
          <td><?php echo  $row['name_tech']?></td>
          <td><?php echo  $row['comment_faulty']?></td>
        </tr>
        <?php }?>
      </table>
      <?php }?></td>
  </tr>
  <?php }?>
</table>
</body>
</html>
